package com.feicheng.lanniao.service.impl;

import com.feicheng.lanniao.entity.Sysvo;
import com.feicheng.lanniao.mapper.SysvoMapper;
import com.feicheng.lanniao.result.ResultInfo;
import com.feicheng.lanniao.service.ISysvoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut;
import org.springframework.stereotype.Service;

/**
 * <p>
 * VIEW 服务实现类
 * </p>
 *
 * @author feichengTech
 * @since 2021-09-25
 */
@Service
public class SysvoServiceImpl extends ServiceImpl<SysvoMapper, Sysvo> implements ISysvoService {

	@Override
	public ResultInfo getInfo(Integer provienceId, Integer cityId, Integer reignId) {
		QueryWrapper<Sysvo> queryWrapper = new QueryWrapper<Sysvo>();
		if (null != provienceId ) {
			queryWrapper.eq("shisr_id", provienceId);
		}
		if (null != cityId) {
			queryWrapper.eq("shengsr_id", cityId);
		}
		if (null != reignId) {
			queryWrapper.eq("zongsr_id", reignId);
		}
		
		return ResultInfo.success(this.getOne(queryWrapper));
	}

}
